Page({
  data: {

  },
  onLoad(options) {
  },
  onScan() {
    wx.scanCode({
      onlyFromCamera: true,
      success(r) {
        const KEY_CODE = 'DGQHqGSRQhqRF_RHQHhyda';
        if (r.result.startsWith(KEY_CODE)) {
          wx.navigateTo({
            url: `/pages/user/coupon/list?order_id=${r.result.substring(KEY_CODE.length)}`,
          })
        } else {
          wx.showToast({
            title: '二维码已失效',
            icon: 'none'
          })
        }
      }
    })
  },
})